/* ============ 抽屉遮罩 ============ */

.drawer-mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 999;
    transition: background 0.3s ease;
}

.drawer-mask.active {
    background: rgba(0, 0, 0, 0.5);
}

/* ============ 抽屉容器 ============ */

.drawer {
    position: fixed;
    background: white;
    z-index: 1000;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    transition: all 0.3s ease;
}

/* ============ 抽屉方向 ============ */

.drawer-left {
    top: 0;
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
}

.drawer-left.active {
    transform: translateX(0);
}

.drawer-right {
    top: 0;
    right: 0;
    bottom: 0;
    transform: translateX(100%);
}

.drawer-right.active {
    transform: translateX(0);
}

.drawer-top {
    top: 0;
    left: 0;
    right: 0;
    transform: translateY(-100%);
}

.drawer-top.active {
    transform: translateY(0);
}

.drawer-bottom {
    bottom: 0;
    left: 0;
    right: 0;
    transform: translateY(100%);
}

.drawer-bottom.active {
    transform: translateY(0);
}

/* ============ 抽屉头部 ============ */

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.drawer-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.drawer-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    border-radius: 4px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.drawer-close:hover {
    background: var(--bg-light);
    color: var(--text-primary);
}

/* ============ 抽屉内容 ============ */

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
}

/* ============ 响应式 ============ */

@media (max-width: 768px) {
    .drawer-left,
    .drawer-right {
        width: 80% !important;
        max-width: 400px;
    }

    .drawer-top,
    .drawer-bottom {
        height: 60% !important;
        max-height: 400px;
    }

    .drawer-header {
        padding: 12px;
    }

    .drawer-title {
        font-size: 16px;
    }

    .drawer-body {
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .drawer-left,
    .drawer-right {
        width: 100% !important;
    }

    .drawer-top,
    .drawer-bottom {
        height: 70% !important;
    }

    .drawer-header {
        padding: 12px;
    }

    .drawer-title {
        font-size: 15px;
    }

    .drawer-body {
        padding: 12px;
        font-size: 13px;
    }
}
